


package controller;




import bo.BUS_ChiTietHoaDon;
import com.opensymphony.xwork2.ActionSupport;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.interceptor.ServletRequestAware;



public class CapNhatCTHDAction extends ActionSupport implements ServletRequestAware {

    private int SoLuong;
    private HttpServletRequest request;

    public int getSoLuong() {
        return SoLuong;
    }

    public void setSoLuong(int SoLuong) {
        this.SoLuong = SoLuong;
    }


    public CapNhatCTHDAction() {

    }



    public String execute() throws Exception {

        int MaHD = Integer.parseInt(request.getParameter("MaHD"));
        int MaSP = Integer.parseInt(request.getParameter("MaSP"));
        BUS_ChiTietHoaDon busCTHD = new BUS_ChiTietHoaDon();
        boolean flag = busCTHD.CapNhatCTHD(MaHD, SoLuong,MaSP);
        if(flag == true)
        {
            return "success";
        }
        return "fail";

    }

    @Override
    public void setServletRequest(HttpServletRequest hsr) {
        request = hsr;
    }



}